
#include "debug.h"
#include "serial_linux.h"
#include "sensorInterface.h"

#define TTY_NODE "/dev/ttyUSB0"



int onrecv(char *data, int len)
{


}


int main(int argc, char *argv[])
{
    int ret = 0;

    d_init_debug(argv[0], DEBUG_DEBUG, DEBUG_NONE, DEBUG_COLOR_WHITE, DEBUG_COLOR_NONE);
    if(sensor_init(TTY_NODE)){
        d_info("serial opend");
    }

    sensor_set_datacallback(onrecv);

    sleep(1);
    sensor_start();

    while(1){
        sleep(1);
    }

    sensor_stop();
    sensor_release();


    d_destroy_debug();

    return ret;
}
